home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / pic.vim < prev    next >
Encoding:
Text File  |  2001-05-11  |  3.8 KB  |  130 lines

  1. " Vim syntax file
  2. " Language:     PIC16F84 Assembler (Microchip's microcontroller)
  3. " Maintainer:   Aleksandar Veselinovic <alexa@cliffhanger.com>
  4. " Last Change:  2001 May 10
  5. " URL:          http://SOLAIR.EUnet.yu/~aleksav/vim/syntax/pic.vim
  6. " Revision:     1.0
  7.  
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if version < 600
  11.   syntax clear
  12. elseif exists("b:current_syntax")
  13.   finish
  14. endif
  15.  
  16. syn case match
  17. syn keyword picTodo NOTE TODO XXX contained
  18.  
  19.  
  20. syn case ignore
  21.  
  22. syn match picIdentifier "[a-z_$][a-z0-9_$]*"
  23. syn match picLabel      "^[A-Z_$][A-Z0-9_$]*"
  24. syn match picLabel      "^[A-Z_$][A-Z0-9_$]*:"me=e-1
  25.  
  26. syn match picASCII      "A\='.'"
  27. syn match picBinary     "B'[0-1]\+'"
  28. syn match picDecimal    "D'\d\+'"
  29. syn match picDecimal    "\d\+"
  30. syn match picHexadecimal "0x\x\+"
  31. syn match picHexadecimal "H'\x\+'"
  32. syn match picHexadecimal "[0-9]\x*h"
  33. syn match picOctal      "O'[0-7]\o*'"
  34.  
  35.  
  36. syn match picComment    ";.*" contains=picTodo
  37.  
  38. syn region picString    start=+"+ end=+"+
  39.  
  40. syn keyword picRegister         INDF TMR0 PCL STATUS FSR PORTA PORTB
  41. syn keyword picRegister         EEDATA EEADR PCLATH INTCON INDF OPTION_REG PCL
  42. syn keyword picRegister         FSR TRISA TRISB EECON1 EECON2 INTCON OPTION
  43.  
  44.  
  45. " Register --- bits
  46.  
  47. " STATUS
  48. syn keyword picRegisterPart     IRP RP1 RP0 TO PD Z DC C
  49.  
  50. " PORTA
  51. syn keyword picRegisterPart     T0CKI
  52. syn match   picRegisterPart     "RA[0-4]"
  53.  
  54. " PORTB
  55. syn keyword picRegisterPart     INT
  56. syn match   picRegisterPart     "RB[0-7]"
  57.  
  58. " INTCON
  59. syn keyword picRegisterPart     GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
  60.  
  61. " OPTION
  62. syn keyword picRegisterPart     RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
  63.  
  64. " EECON2
  65. syn keyword picRegisterPart     EEIF WRERR WREN WR RD
  66.  
  67. " INTCON
  68. syn keyword picRegisterPart     GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
  69.  
  70.  
  71. " OpCodes...
  72. syn keyword picOpcode  ADDWF ANDWF CLRF CLRW COMF DECF DECFSZ INCF INCFSZ
  73. syn keyword picOpcode  IORWF MOVF MOVWF NOP RLF RRF SUBWF SWAPF XORWF
  74. syn keyword picOpcode  BCF BSF BTFSC BTFSS
  75. syn keyword picOpcode  ADDLW ANDLW CALL CLRWDT GOTO IORLW MOVLW RETFIE
  76. syn keyword picOpcode  RETLW RETURN SLEEP SUBLW XORLW
  77. syn keyword picOpcode  GOTO
  78.  
  79.  
  80. " Directives
  81. syn keyword picDirective __BADRAM BANKISEL BANKSEL CBLOCK CODE __CONFIG
  82. syn keyword picDirective CONSTANT DATA DB DE DT DW ELSE END ENDC
  83. syn keyword picDirective ENDIF ENDM ENDW EQU ERROR ERRORLEVEL EXITM EXPAND
  84. syn keyword picDirective EXTERN FILL GLOBAL IDATA __IDLOCS IF IFDEF IFNDEF
  85. syn keyword picDirective INCLUDE LIST LOCAL MACRO __MAXRAM MESSG NOEXPAND
  86. syn keyword picDirective NOLIST ORG PAGE PAGESEL PROCESSOR RADIX RES SET
  87. syn keyword picDirective SPACE SUBTITLE TITLE UDATA UDATA_OVR UDATA_SHR
  88. syn keyword picDirective VARIABLE WHILE INCLUDE
  89. syn match picDirective   "#\=UNDEFINE"
  90. syn match picDirective   "#\=INCLUDE"
  91. syn match picDirective   "#\=DEFINE"
  92.  
  93.  
  94.  
  95. " Define the default highlighting.
  96. " For version 5.7 and earlier: only when not done already
  97. " For version 5.8 and later: only when an item doesn't have highlighting yet
  98. if version >= 508 || !exists("did_pic16f84_syntax_inits")
  99.   if version < 508
  100.     let did_pic16f84_syntax_inits = 1
  101.     command -nargs=+ HiLink hi link <args>
  102.   else
  103.     command -nargs=+ HiLink hi def link <args>
  104.   endif
  105.  
  106.   HiLink picTodo               Todo
  107.   HiLink picComment            Comment
  108.   HiLink picDirective          Statement
  109.   HiLink picLabel              Label
  110.   HiLink picString             String
  111.  
  112.  "HiLink picOpcode            Keyword
  113.  "HiLink picRegister          Structure
  114.  "HiLink picRegisterPart      Special
  115.  
  116.   HiLink picASCII              String
  117.   HiLink picBinary             Number
  118.   HiLink picDecimal            Number
  119.   HiLink picHexadecimal        Number
  120.   HiLink picOctal              Number
  121.  
  122.   HiLink picIdentifier         Identifier
  123.  
  124.   delcommand HiLink
  125. endif
  126.  
  127. let b:current_syntax = "pic"
  128.  
  129. " vim: ts=8
  130.